package com.ncst.backend.service.impl;

import com.ncst.backend.domain.Disease;
import com.ncst.backend.mapper.DiseaseMapper;
import com.ncst.backend.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiseaseServiceImpl implements DiseaseService {

    @Autowired
    private DiseaseMapper diseaseMapper;

    @Override
    public Disease selectById(Integer id) {
        return diseaseMapper.selectById(id);
    }

    @Override
    public List<Disease> selectAll() {
        return diseaseMapper.selectAll();
    }

    @Override
    public List<Disease> selectByCondition(Disease disease) {
        return diseaseMapper.selectByCondition(disease);
    }

    @Override
    public List<Disease> selectByPage(Integer page, Integer size) {
        int offset = (page - 1) * size;
        return diseaseMapper.selectByPage(offset, size);
    }

    @Override
    public Long countAll() {
        return diseaseMapper.countAll();
    }

    @Override
    public Long countByCondition(Disease disease) {
        return diseaseMapper.countByCondition(disease);
    }

    @Override
    public int insert(Disease disease) {
        return diseaseMapper.insert(disease);
    }

    @Override
    public int insertBatch(List<Disease> list) {
        return diseaseMapper.insertBatch(list);
    }

    @Override
    public int updateById(Disease disease) {
        return diseaseMapper.updateById(disease);
    }

    @Override
    public int deleteById(Integer id) {
        return diseaseMapper.deleteById(id);
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return diseaseMapper.deleteByIds(ids);
    }
}